As new microcontroller architectures become feasible due to cost reductions for a variety of reasons and new techniques for improving the performance of microcontrollers become available, it is desirable to provide complete compatibility between old and new members of a family of microcontrollers to protect the investment of customers in program code and expertise with a particular design. These desires result in tradeoffs between optimizing performance of a microcontroller with a new architecture while maintaining complete backwards compatibility. The present invention has particular application to an existing microcontroller sold under the product name MCS-51 by Intel Corporation and a new microcontroller known as MCS-251, also available from Intel Corporation. The major differences between the architectures of the two microcontrollers are as follows:
1. Extended code and data spaces: The MCS-51 has 256 bytes of internal data, 64K of external data, and 64K of program memory. The MCS-251 in comparison has 16M, extendible to 4G, of single address space.
2. Unified address space: Single address space in the MCS-251 makes CPU and compiler implementations easier. In the MCS-51, program memory, data memory and internal registers each lie in a separate address space.
3. Extended stack: MCS-251 provides 64K of stack space (Extendible to 4G) compared to 256 bytes on the MCS-51.
4. Extended bit addressability: In the MCS-251, the special function registers (SFRs) and directly addressable RAM are bit addressable.
5. Extended register file: MCS-251 architecture has 24 more bytes of registers than the MCS-51 architecture.
6. Instruction set: The MCS-251 architecture provides an instruction set which is a superset of the MCS-51 instruction set.
7. Availability of extended address space: The MCS-251 architecture makes the MCS-251 extended address spaces accessible to the MCS-51 instruction set. This allows existing users to utilize their investments in MCS-51 software tools to tap the benefits of the MCS-251 architecture.
In the following description, the techniques of the present invention are described with reference to the MCS-51 and the MCS-251 architectures. However, the references to these two architectures are for convenience in describing the invention with respect to real world examples. Persons skilled in the art will recognize that the invention has application to other architectures as well.